import React, {useState} from 'react';
import { Modal, Button } from 'antd';
import CLoginForm from '../loginForm';

const CLoginModal = () => {

  const [login_seen, setLoginSeen] = useState(false);

  const loginClick = (e) => {
    setLoginSeen(true);
    e.preventDefault();
  }
  const loginCancel = () => {
    setLoginSeen(false);
  }

  return (
    <div>
      <Button 
        type="text" 
        style={{color: '#fff'}}
        onClick={loginClick}
        >
        login
      </Button>
      <Modal
        title="Login Form"
        visible={login_seen}
        onCancel={loginCancel}
        footer={null}
      >
        <CLoginForm loginCancel={loginCancel} />
      </Modal>
    </div>
  )
}

export default CLoginModal;